﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.ComponentModel;

namespace Chinaer.WCF.Contracts
{
    public partial interface IChinaer
    {
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
             RequestFormat = WebMessageFormat.Json,
              BodyStyle = WebMessageBodyStyle.Bare,
              UriTemplate = "AddProvince"
            )]
        [Description("添加省份")]
        Chinaer.Model.Common.JsonResult AddProvince(DTO.ProvinceDTO provinceDTO);

        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
             RequestFormat = WebMessageFormat.Json,
              BodyStyle = WebMessageBodyStyle.Bare,
              UriTemplate = "UpdateProvince"
            )]
        [Description("更新省份信息")]
        Chinaer.Model.Common.JsonResult UpdateProvince(DTO.ProvinceDTO provinceDTO);

        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
             RequestFormat = WebMessageFormat.Json,
              BodyStyle = WebMessageBodyStyle.Bare,
              UriTemplate = "DeleteProvince"
            )]
        [Description("删除省份信息")]
        Chinaer.Model.Common.JsonResult DeleteProvince(DTO.ProvinceDTO provinceDTO);

        [OperationContract]
        [WebInvoke(Method = "GET",
            ResponseFormat = WebMessageFormat.Json,
             RequestFormat = WebMessageFormat.Json,
              BodyStyle = WebMessageBodyStyle.Bare,
              UriTemplate = "DeleteProvinceByID/{provinceID}/{apiToken}"
            )]
        [Description("根据省份编号删除省份")]
        Chinaer.Model.Common.JsonResult DeleteProvinceByID(string provinceID, string apiToken);

        [OperationContract]
        [WebInvoke(Method = "GET",
            ResponseFormat = WebMessageFormat.Json,
             RequestFormat = WebMessageFormat.Json,
              BodyStyle = WebMessageBodyStyle.Bare,
              UriTemplate = "GetProvinceByCountryID/{countryID}/{apiToken}"
            )]
        [Description("根据国家编号获取省份列表")]
        List<DTO.ProvinceDTO> GetProvinceByCountryID(string countryID,string apiToken);
    }
}
